****SET PATH TO DIRECTORY BEFORE RUNNING CODE

import delimited "data/df_long.csv", clear


replace close_relationship2 = "" if close_relationship2 == "NA"

label define social_distance 1 "None" 2 "Tourist" 3 "Citizens" 4 "Coworker" 5 "Neighbour" 6 "Friend" 7 "Close family"

encode close_relationship2, gen(close_var) label(social_distance)

keep if d_ownparty == 0
keep if d_affiliated == 1
encode meta_uuid, gen(id)
encode dem_country_code, gen(countries)
xtset id


mlogit close_var feeling_toward, base(1)
estimates store m1

mlogit close_var feeling_toward i.countries, base(1)
estimates store m_countriesFE

femlogit close_var feeling_toward, base(1)
estimates store m_indFE

gen flag=1 if e(sample)==1

esttab m1 m_countriesFE m_indFE using "tables/TableA5.html", replace ///
			nocons drop(*.countries) label plain par ///
			b(3) p(3) star(* 0.10 ** 0.05 *** 0.01)
